package com.gyg.client;

import com.gyg.returns.RespEntity;
import com.gyg.vo.param.LoginParam;
import com.gyg.vo.param.RegisterParam;
import com.gyg.vo.param.UserParam;
import com.gyg.vo.param.UserPwdParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "cloudUserClient", url = "${cloud.box.url}")
public interface CloudUserClient {

    /**
     * 校验账号
     * @param username
     * @return
     */
    @GetMapping("/cloud-user/check")
    RespEntity checkUsername(@RequestParam(value = "username", required = true) String username);

    /**
     * 用户注册
     * @param registerParam
     * @return
     */
    @PostMapping("/cloud-user/register")
    RespEntity register(@RequestBody RegisterParam registerParam);

    /**
     * 用户登陆
     * @param loginParam
     * @return
     */
    @PostMapping("/cloud-user/login")
    RespEntity login(@RequestBody LoginParam loginParam);

    /**
     * 编辑用户
     * @param userParam
     * @return
     */
    @PutMapping("/cloud-user/update")
    RespEntity updateUser(@RequestBody UserParam userParam);

    /**
     * 校验用户旧密码
     * @param userPwdParam
     * @return
     */
    @PostMapping("/cloud-user/checkPwd")
    RespEntity checkPassword(@RequestBody UserPwdParam userPwdParam);

    /**
     * 修改密码
     * @param userPwdParam
     * @return
     */
    @PutMapping("/cloud-user/updatePwd")
    RespEntity updatePassword(@RequestBody UserPwdParam userPwdParam);

    /**
     * 用户信息
     * @param userId
     * @return
     */
    @GetMapping("/cloud-user/info")
    RespEntity userInfo(@RequestParam(value = "userId", required = true) Integer userId);


}
